import configparser

from ConfigFile.Varconfig import elementLocationPath


class ParserConfigFile:

    def __init__(self):
        self.cf = configparser.ConfigParser()
        self.cf.read(elementLocationPath)

    def getSection(self,sectionName):
        '''
        读取配置内容，以字典形式
        :param sectionName:
        :return:
        '''
        oprionDict = dict(self.cf.items(sectionName))
        return oprionDict

if __name__ == '__main__':
    parse = ParserConfigFile()
    print(parse.getSection('163main_login'))